package jmine.tec.aom.export;

import java.util.ArrayList;
import java.util.List;

import jmine.tec.aom.domain.Property;
import jmine.tec.services.api.export.AbstractServiceFillerEntityExporter;
import jmine.tec.services.api.export.DefaultExportAction;
import jmine.tec.services.api.export.ServiceFiller;

/**
 * Defines an abstract {@link jmine.tec.services.api.export.ServiceFiller} based export strategy for {@link Property}.
 * 
 * @param <P> the {@link Property} type
 * @author jrenaut
 */
public abstract class AbstractPropertyExporter<P extends Property> extends AbstractServiceFillerEntityExporter<P> {

    /**
     * @param serviceFiller a {@link ServiceFiller}
     */
    public AbstractPropertyExporter(ServiceFiller<P> serviceFiller) {
        super(serviceFiller, DefaultExportAction.INCLUIR);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<Object> exportBefore(P entity) {
        List<Object> before = new ArrayList<Object>(super.exportBefore(entity));
        before.add(entity.getPropertyType());
        return before;
    }

}
